<?php

/**
 * Subclass for performing query and update operations on the 'language' table.
 *
 * 
 *
 * @package lib.model
 */ 
class LanguagePeer extends BaseLanguagePeer
{
  public static function retrieveNameByCulture($culture)
  {
    $c = new Criteria();
    $c->add(LanguagePeer::CULTURE, $culture);
    $language = LanguagePeer::doSelectOne($c);
    if($language instanceof Language)
    {
      return $language->getName();
    }
    return false;
  }
  
  public static function retrieveByLang($lang)
  {
    $c = new Criteria();
    $c->add(LanguagePeer::CULTURE, $lang.'%', Criteria::LIKE);
    return LanguagePeer::doSelectOne($c);
  }
  
  public static function retrieveByCulture($culture)
  {
    $c = new Criteria();
    $c->add(LanguagePeer::CULTURE, $culture);
    return LanguagePeer::doSelectOne($c);
  }  
}
